package day04;

import java.util.Scanner;

/*
    用switch编写一个简易计算器
 */
public class Switch {
    public static void main(String[] args) {
        //创建键盘录入对象
        Scanner sc = new Scanner(System.in);

        //键盘录入
        double a = sc.nextDouble();
        String temp = sc.next();
        double b = sc.nextDouble();

        //检测temp的选择
        switch (temp){
            case "+":
                System.out.println("结果为:"+(a+b));break;
            case "-":
                System.out.println("结果为:"+(a-b));break;
            case "*":
                System.out.println("结果为:"+(a*b));break;
            case "/":
                System.out.println("结果为:"+(a/b));break;
            default:
                System.out.println("你输入的运算符不合法！");
                break;
        }

    }
}
